FIND_PATH(GD_INCLUDE_DIR gd.h /usr/include/ /usr/local/include/)

FIND_LIBRARY(GD_LIBRARY NAMES gd PATH /usr/lib /usr/local/lib) 

IF (GD_INCLUDE_DIR AND GD_LIBRARY)
  SET(GD_FOUND TRUE)
ENDIF (GD_INCLUDE_DIR AND GD_LIBRARY)


IF (GD_FOUND)
  IF (NOT GD_FIND_QUIETLY)
    MESSAGE(STATUS "Found libgd: ${GD_LIBRARY}")
  ENDIF (NOT GD_FIND_QUIETLY)
ELSE (GD_FOUND)
  IF (GD_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could not find libgd")
  ENDIF (GD_FIND_REQUIRED)
ENDIF (GD_FOUND)
